<template>
  <div :key="key">
    <comment_firstVue :data="allcomment.level_first" />
    <div v-for="(i, index) in allcomment.level_two" :key="index">
      <comment_secondVue :data="i" :level_first="allcomment.level_first.id" />
    </div>
  </div>
</template>

<script>
import comment_firstVue from "./comment_first.vue";
import comment_secondVue from "./comment_second.vue";
import {nanoid} from 'nanoid'
export default {
  name: "comment",
  data(){
    return {
      key:nanoid()
    }
  },
  props:{
    allcomment:{},
  },
  components: { comment_firstVue, comment_secondVue },
  beforeDestroy(){
    this.$store.commit("sendLikes")
  },
  mounted(){
    // console.log(this.allcomment)
  }

};
</script>

<style lang="less" scoped>
@import "../main.less";
.comment_sec {
  height: 65px;
  width: 100%;
  border: 1px solid #ccc;
}
</style>